Skip to content

fix: resolve failing tests and implement missing utilities - #460

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-924-1794316781
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-924-1794316781

Conversation

@stooit

@stooit stooit commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • calculator.divide: throws Error("Division by zero") when b === 0.
  • date-utils.formatRelative: days now rounded (Math.round(|hours|/24)) instead of floored; fixes off-by-one (36h → "2 days ago").
  • string-utils: implemented truncate (word-boundary, ... counts toward maxLength, hard-cut fallback, tiny maxLength handled); wordCount splits on /\s+/ after trim.
  • task-manager: implemented remove, update (whitelisted fields only), sortBy (priority, status, createdAt).
  • validator: isEmail accepts TLDs of 2+ chars; isUrl accepts URLs with ports.
  • Stale BUG/TODO comments updated.

Verification

bun test: 60 pass / 0 fail (previously 16 failing). tsc --noEmit clean. Reviewed twice by review agent; no blockers.

Assumptions

  • Dividing by zero should throw (per tests) rather than return Infinity.
  • TaskManager.update ignores undefined values for all fields, so description can't be cleared via undefined; easy to change if clearing is desired.
  • No test files modified, no dependencies added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant